
var app = {
    // Application Constructor
    initialize: function() {
        document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
    },
    onDeviceReady: function() {
        console.log("deviceReady");
        document.getElementById("startTalk").onclick = function () {
            console.log("startTalk");
            window.location.href="video.html?roomName="+document.getElementById("roomName").value;
        };
        var connection = new RTCMultiConnection();
        connection.socketURL = 'https://www.sheepony.win:443/';
        connection.session = {
            data:  true
        };
        connection.iceServers = [];
        connection.iceServers.push({
            urls: 'stun:59.110.239.23'
        });
        connection.iceServers.push({
            urls: 'turn:59.110.239.23:3476',
            credential: 'test',
            username: 'test'
        });
        connection.openOrJoin("getRoom");
        
    },
};

app.initialize();